import Vue from 'vue'

export const documentSetInterval = () => {
//   const FREQUENCY = Vue.ls.get('DEFAULT_BACKGROUND_WEAK')
//   const res = FREQUENCY.split(',')
  setInterval(() => {
    const FREQUENCY = Vue.ls.get('DEFAULT_BACKGROUND_WEAK')
    const res = FREQUENCY.split(',')
    // 时间
    const calendar = document.querySelectorAll('.ant-calendar')
    for (let i = 0; i < calendar.length; i++) {
      calendar[i].style.background = res[0]
    }
    // Menu 导航菜单
    const popoverInner = document.querySelectorAll('.ant-popover-inner')
    for (let i = 0; i < popoverInner.length; i++) {
      popoverInner[i].style.background = res[0]
    }
    const antmenu = document.querySelectorAll('.ant-menu')
    for (let i = 0; i < antmenu.length; i++) {
      antmenu[i].style.background = res[0]
    }
    const popoverArrow = document.querySelectorAll('.ant-popover-arrow')
    for (let i = 0; i < popoverArrow.length; i++) {
      popoverArrow[i].style.borderLeftColor = res[0]
      popoverArrow[i].style.borderTopColor = res[0]
      popoverArrow[i].style.background = res[0]
    }
    // 时间
    const timePicker = document.querySelectorAll('.ant-time-picker-panel-inner')
    for (let i = 0; i < timePicker.length; i++) {
      timePicker[i].style.background = res[0]
    }
    // 下拉
    const select = document.querySelectorAll('.ant-select-dropdown')
    for (let i = 0; i < select.length; i++) {
      select[i].style.background = res[0]
    }
    // Dropdown 下拉菜单
    const dropdown = document.querySelectorAll('.ant-dropdown-menu')
    for (let i = 0; i < dropdown.length; i++) {
      dropdown[i].style.background = res[0]
    }
    // modal
    const antmodal = document.querySelectorAll('.ant-modal-content')
    for (let i = 0; i < antmodal.length; i++) {
      antmodal[i].style.background = res[0]
    }
    //  ant - notification - notice - closable
    // modal
    const notificationNotice = document.querySelectorAll('.ant-notification-notice')
    for (let i = 0; i < notificationNotice.length; i++) {
      notificationNotice[i].style.background = res[0]
    }
  }, 0)
}
